﻿using Abp.Application.Services.Dto;
using shenghua.Common.Articles;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace shenghua.Articles.Dto
{
    public class ArticleDto: EntityDto
    {
        public string Title { get; set; }
        public List<string> Tags { get; set; }
        public string Author { get; set; }
        public string Source { get; set; }
        public string Description { get; set; }
        public string Picture { get; set; }
        public List<string> Pictures { get; set; }
        public string Content { get; set; }
        public ArticleSystemType SystemType { get; set; }
        public string Type1 { get; set; }
        public string Type2 { get; set; }
        public string Type3 { get; set; }
        public int CommentCount { get; set; }
        public int ClickCount { get; set; }
        public ArticleStatus Status { get; set; }
        public bool Enabled { get; set; }
        public DateTime CreationTime { get; set; }
        public long? CreatorUserId { get; set; }
        public long? LastModifierUserId { get; set; }
        public DateTime? LastModificationTime { get; set; }

        public ArticleDto PrevArticle { get; set; }
        public ArticleDto NextArticle { get; set; }

        public ArticleDto()
        {
        }

        public ArticleDto(Article article)
        {
            Id = article.Id;
            Title = article.Title;
            Tags = article.Tags.Items;
            Author = article.Author;
            Source = article.Source;
            Description = article.Description;
            Picture = article.Picture;
            Pictures = article.Pictures.Items;
            Content = article.Content;
            SystemType = article.SystemType;
            Type1 = article.Type1;
            Type2 = article.Type2;
            Type3 = article.Type3;
            CommentCount = article.CommentCount;
            ClickCount = article.ClickCount;
            Status = article.Status;
            Enabled = article.Enabled;
            CreationTime = article.CreationTime;
            CreatorUserId = article.CreatorUserId;
            LastModificationTime = article.LastModificationTime;
            LastModifierUserId = article.LastModifierUserId;
        }
    }
}
